<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
${r }
	<table>
		<c:forEach items="${list.records }" var="l">
			<tr>
				<td>${l.id}</td>
			</tr>
		</c:forEach>

	</table>
	
	<form id="editorBasicForm" class="form-horizontal" style="margin-top: 30px;" enctype="multipart/form-data">
			<input type="file" name="headurl"/>
			<input onclick="upload()" type="button" value="上传"/>
	</form>
</body>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery.form.js"></script>
<script type="text/javascript">
function upload(){
	$("#editorBasicForm").ajaxSubmit({
				url : "/upload",
				dataType : "json",
				data : $("#editorBasicForm").serialize(),
				type : "post",
				success : function(data) {
					alert(data.data);
				}
			});
}
</script>
</html>